package com.cn.wanxi.servlet;

import com.cn.wanxi.model.CompanyModel;
import com.cn.wanxi.model.NavModel;
import com.cn.wanxi.service.CompanyService;
import com.cn.wanxi.service.NavService;

import javax.servlet.http.HttpServletRequest;

class CommonServlet {
    static void setCommonData(HttpServletRequest req) {
        CompanyService companyService = new CompanyService();
        CompanyModel companyModel = companyService.setCompanyModel();
        req.setAttribute("companyModel", companyModel);
//        所有的数据封装都是在逻辑层执行
        NavService navService=new NavService();
        NavModel[] navModels=navService.getNavModels();
        req.setAttribute("navModels", navModels);
    }
}
